const router = require('express').Router()
const handler = require('./handler')
const schema = require('./schema')
const expressJoi = require('@escook/express-joi')
//获取用户信息
router.get('/userinfo', handler.getUserInfo)

//更新用户信息
router.post(
  '/userinfo',
  expressJoi(schema.id_nickname_email),
  handler.updateUserInfo
)

//更新密码
router.post('/updatepwd', expressJoi(schema.old_new_pwd), handler.updatePwd)

//更新头像
router.post('/update/avatar', expressJoi(schema.avatar), handler.updateAva)

module.exports = router
